Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Add ability to seed Arr::shuffle() #23490

Merged
merged 2 commits into from Mar 12, 2018
Merged

[5.6] Add ability to seed Arr::shuffle() #23490

merged 2 commits into from Mar 12, 2018

Conversation

timacdonald
Copy link
Member

Ability to seed the array shuffle method. This is already available in Collection, but I've moved the functionality to Arr so it is accessible there also.

$seedShuffled = Arr::shuffle($array, date('H'))

@@ -541,11 +541,20 @@ public static function set(&$array, $key, $value)
* Shuffle the given array and return the result.
*
* @param array $array
* @param int $seed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int|null

@taylorotwell taylorotwell merged commit 91ee51f into laravel:5.6 Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants